package commonwebgroup.commonwebartifact.CommandHandle;

import commonwebgroup.commonwebartifact.util.StringUtil;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;

import java.util.Set;
import java.util.UUID;

/**
 * @author: wuxin0011
 * @Description: CommandSender 默认实现
 */
public class CommandCenterHandleDefault implements CommandSender {


    @Override
    public void sendMessage(String s) {
        sendMessage("发送消息模板");
    }

    @Override
    public void sendMessage(String... strings) {
        sendMessage("发送消息模板 strings");
    }

    @Override
    public void sendMessage(UUID uuid, String s) {
        System.out.println("发送消息模板 uuid s");
    }

    @Override
    public void sendMessage(UUID uuid, String... strings) {
        System.out.println("发送消息模板 uuid strings");
    }

    @Override
    public Server getServer() {
        return null;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public Spigot spigot() {
        return null;
    }

    @Override
    public boolean isPermissionSet(String s) {
        return false;
    }

    @Override
    public boolean isPermissionSet(Permission permission) {

        System.out.println("检查指令方法还未来实现！");
        return false;
    }

    @Override
    public boolean hasPermission(String s) {
        System.out.println("使用默认命令解析！");
        if (StringUtil.isEmpty(s)) {
            return false;
        }
        if (s.contains("mcm.reload")) {
            return true;
        }
        return false;
    }

    @Override
    public boolean hasPermission(Permission permission) {
        return false;
    }

    @Override
    public PermissionAttachment addAttachment(Plugin plugin, String s, boolean b) {
        return null;
    }

    @Override
    public PermissionAttachment addAttachment(Plugin plugin) {
        return null;
    }

    @Override
    public PermissionAttachment addAttachment(Plugin plugin, String s, boolean b, int i) {
        return null;
    }

    @Override
    public PermissionAttachment addAttachment(Plugin plugin, int i) {
        return null;
    }

    @Override
    public void removeAttachment(PermissionAttachment permissionAttachment) {

    }

    @Override
    public void recalculatePermissions() {

    }

    @Override
    public Set<PermissionAttachmentInfo> getEffectivePermissions() {
        return null;
    }

    @Override
    public boolean isOp() {
        return false;
    }

    @Override
    public void setOp(boolean b) {

    }
}
